In [ ]:
import sys
# path to the src folder of the repository
# sys.path.append('/Users/dhruviljoshi/Documents/koding/cns/hra-amap/src')
sys.path.append('../src')

import trimesh

from organ import Organ
from tissue import TissueBlock
from pipeline import Pipeline
In [ ]:
# load source and target organs
# source = Organ(path='/Users/dhruviljoshi/Documents/koding/cns/hra-amap/data/Pancreas/Source/generic-pancreas-organ.glb')
# target = Organ(path='/Users/dhruviljoshi/Documents/koding/cns/hra-amap/data/Pancreas/Reference/VH_F_Pancreas.glb')

source = Organ(path='../data/3d-vh-m-kidney-l.glb')
target = Organ(path='../data/3d-vh-m-kidney-r.glb')
In [30]:
source.show()
Out[30]:
In [31]:
target.show()
Out[31]:
In [32]:
# instantiate the registration pipeline
pipeline = Pipeline(name='Kidney Registration', description='Projecting the Male Left kidney to Male Right Kidney', params='../configs/params.yaml')
In [33]:
pipeline.params
Out[33]:
{'nonrigid_registration': {'autotune': 'False',
  'gamma': 10,
  'beta': 2,
  'decimation': 'False',
  'distance_threshold': '1e-8',
  'lambda': 10,
  'downsampling': 'Y, 26443, 0.05',
  'max_iterations': 1000,
  'seed': 26},
 'rigid_registration': {'global_distance_threshold_factor': 0.23,
  'global_edge_length_threshold_factor': 0.95,
  'global_max_correspondence': 0.999,
  'global_max_iterations': 100000,
  'max_nn': 100,
  'refine_distance_threshold_factor': 0.1,
  'voxel_size': 0.025}}
In [34]:
# run registration
projections = pipeline.run(source=source, target=target)
In [35]:
 # display result
projections.registration.show()
Out[35]:

Export Projections - Reproducibility and Future Use¶

In [9]:
from dataclass import Projection
In [36]:
# export (remember to modify the save path)
projections.export(path='../projections/')
In [ ]:
# load (remember to modify the load path)
projections = Projection.load(path='../projections/-0d9cef42-a6ed-4d4d-8135-2bda1038aee4')
In [ ]:
!jupyter nbconvert --to html Usage.ipynb
In [ ]: